import java.io.*;
import java.math.BigInteger;

public class Main {

	public static void main(String args[]) throws Exception
	{
	    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

	    BigInteger sum = BigInteger.ZERO;

	    while (true)
	    {
	    	String s = in.readLine();
	    	if (s.equals("0")) break;
	    	BigInteger n = new BigInteger(s);
	    	sum = sum.add(n);
	    }
	    
	    System.out.println(sum.toString());
	}
}
